package dt.tradeAction;

import java.io.IOException;
import java.io.Reader;

import com.ibatis.common.resources.Resources;
import com.ibatis.sqlmap.client.SqlMapClient;
import com.ibatis.sqlmap.client.SqlMapClientBuilder;

public class RatesSqlMapConfig {
	public static Reader reader;
	public static SqlMapClient sqlMapper;
	
	static {
		try {
			reader = Resources.getResourceAsReader("sqlMapConfig.xml"); //sqlMapConfig.xml �좎룞�쇿뜝�숈삕�좎룞���좎룞�쇿뜝�숈삕�좎룞�쇿뜝�숈삕�좎룞���좎룞�쇿뜝�숈삕�좎듅�먯삕.
			sqlMapper = SqlMapClientBuilder.buildSqlMapClient(reader); //sqlMapConfig.xml �좎룞�쇿뜝�숈삕�좎룞���좎룞�쇿뜝�숈삕�좑옙sqlMapper �좎룞�숈껜 �좎룞��
			reader.close(); 

		} catch (IOException e) {
			// Fail fast.
			throw new RuntimeException(
				"SqlMapClient instance Error." + e, e);
		}
	}
	
	public static SqlMapClient getSqlMapInstance() throws IOException {
		return sqlMapper;
	}
}
